<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!doctype html>
<html class="no-js">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="description" content="">
    <meta name="keywords" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>沃店</title>
    <!-- Set render engine for 360 browser -->
    <meta name="renderer" content="webkit">
    <!-- No Baidu Siteapp-->
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <!-- Add to homescreen for Chrome on Android -->
    <meta name="mobile-web-app-capable" content="yes">
    <!-- Add to homescreen for Safari on iOS -->
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-title" content="Amaze UI"/>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/assets/css/amazeui.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/assets/css/app.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/assets/css/index.css">
    <!--必要样式-->
    <style type="text/css">
        body {
            background-color: #EFEFEF;
        }

        .am-u-sm-4 span {
            font-size: 16px;
            font-weight: bold;
        }

        .am-u-sm-8 span {
            font-size: 14px;
            color: #808080;
        }

        .am-g {
            padding: 10px 0;
        }

        .change {
            font-size: 14px;
            color: #808080;
            background-color: #fff;
            float: right;
            border: 1px #ccc solid;
        }
    </style>
</head>

<body>
<header data-am-widget="header" class="am-header am-header-default am-header-fixed">
    <div class="am-header-left am-header-nav">
        <a href="${pageContext.request.contextPath}/clientHome/goStaffNewOrderList" class="">
            <i class="am-header-icon am-icon-chevron-left"></i>
        </a>
    </div>
    <h1 class="am-header-title">
        <a href="#title-link" class="">
            新装订单详情
        </a>
    </h1>
</header>
<div class="am-g whiteBg">
    <div class="am-u-sm-4">
        <span>下单时间</span>
    </div>
    <div class="am-u-sm-8">
        <span>${createTime}</span>
    </div>
</div>
<div class="am-g whiteBg" style="margin-top: 5px;">
    <div class="am-u-sm-4">
        <span>新装用户</span>
    </div>
    <div class="am-u-sm-8">
        <span>${hallOrder.realName}</span><br>
        <span>${hallOrder.contractPhone}</span><br>
        <span>${hallOrder.address}</span>
    </div>
</div>

<div class="am-g whiteBg" style="margin-top: 20px;">
    <div class="am-u-sm-4">
        <span>宽带套餐</span>
    </div>
    <div class="am-u-sm-8">
        <span>${broadbandPackage.packageName}</span><br>
        <span>${broadbandPackage.description}</span><br>
        <span>
            <c:forEach var="device" items="${devices}">
                ${device.deviceName}、
            </c:forEach>

        </span>
        <c:if test="${hallOrder.totalPrice!=null&&hallOrder.totalPrice!=0}">
            <br>
            <span>
                   ￥ ${hallOrder.totalPrice}</span>
        </c:if>
        <c:if test="${hallOrder.transactionId!=null||hallOrder.payType=='线下支付'}">
            <br>
            <span>已支付</span>
        </c:if>
    </div>
</div>

<div class="am-g whiteBg" style="margin-top: 5px;">
    <div class="am-u-sm-4">
        <span>备注</span>
    </div>
    <div class="am-u-sm-8">
        <span>${hallOrder.description}</span>
    </div>
</div>

<c:if test="${handleRecord!=null}">
    <div class="am-g whiteBg userinfo">
        <div class="am-u-sm-4" style="padding-right: 0;">处理结果</div>
        <div class="am-u-sm-8" style="padding-left: 0;">
            <span>${handleRecord.description}</span><br>
        </div>
    </div>
</c:if>

<div class="am-g" align="center" style="margin-top: 80px;">
    <c:if test="${hallOrder.statu==16}">
        <a href="#" onclick="start()">
            <img src="${pageContext.request.contextPath}/images/startnew_big.png">
        </a>
    </c:if>
    <c:if test="${hallOrder.statu==11}">
        <a href="${pageContext.request.contextPath}/clientHome/goNewCompletePro?id=${hallOrder.id}">

            <img src="${pageContext.request.contextPath}/images/complete_big.png">
        </a>

    </c:if>
</div>
<!--[if (gte IE 9)|!(IE)]><!-->
<script src="${pageContext.request.contextPath}/assets/js/jquery.min.js"></script>
<script src="${pageContext.request.contextPath}/assets/js/amazeui.min.js"></script>
<script src="${pageContext.request.contextPath}/layer/layer.js"></script>
<script type="text/javascript">
    function start() {
        $.ajax({
            type: "get",
            url: '${pageContext.request.contextPath}/clientHallOrder/toWork?hallOrderId=${hallOrder.id}',
            dataType: 'json',
            success: function (data) {
                if (data.success) {
                    setInterval(function () {
                        window.location.href = "${pageContext.request.contextPath}/clientHallOrder/detail?hallOrderId=${hallOrder.id}";
                    }, 2000);
                    layer.msg('提交成功，2秒后刷新。');
                } else {
                    layer.msg(data.msg);
                }
            },
            error: function () {
                layer.msg('网络超时');
            }

        });
    }

</script>
</body>

</html>
